package BookTest;

public class C3Fruit {
    private String variety;
    private String color;
    private double price;
    public C3Fruit(){}
    public C3Fruit(String variety, String color, double price) {
        this.variety = variety;
        this.color = color;
        this.price = price;
    }
    public void setVariety(String variety) {
        this.variety = variety;
    }
    public String getVariety() {
        return variety;
    }
    public void setColor(String color) {
        this.color = color;
    }
    public String getColor() {
        return color;
    }
    public void setPrice(double price) {
        this.price = price;
    }
    public double getPrice() {
        return price;
    }
    @Override
    public String toString(){
        double weight = 2500.00;
        this.price = weight /500.00*4.98;
        return this.color +"的苹果被称为“"+this.variety+"”,每500克4.98元，买了"+weight+"克“糖心苹果”要支付"+this.price;
    }
}
